*************************************************************************
***********************Figure 1: SO2 Emissions over time*****************
*************************************************************************

grstyle init
grstyle set plain
grstyle set color tableau

cd $PATH

* EDGAR time series
use so2_country_combine.dta, clear

drop if year<1990

twoway (line emission year if IPCC=="total", lwidth(medthick) lc(black))  ///
       (line emission year if IPCC=="1.A.1.a", lwidth(medthick) lc(sea))  ///
	   (line emission year if IPCC=="1.A.2", lwidth(medthick) lc(orange)),  ///
	   legend(pos(6) cols(3) symxsize(8) size(small) label(1 "Total") label(2 "Power Industry") ///
		label(3 "Manufacturing and Construction") region(lwidth(none))) xlabel(1990(5)2015, labsize(small))  ///
	   ytitle("Gg", size(small) margin(medsmall)) xtitle("Year", size(small))  ///
	   ylabel(0(10000)40000, gmin gmax labsize(small) ) 

graph export fig1_edgar.eps, replace

* CHNS COMMUNITIES
use so2_match_long.dta, clear

collapse (sum) so2_total_ann so2_manu_ann so2_power_ann, by(year)
drop if year<1990

twoway (line so2_total_ann year, lw(medthick) lc(black))  ///
	   (line so2_power_ann year, lw(medthick) lc(sea))    ///
	   (line so2_manu_ann year, lw(medthick) lc(orange)),  ///
       xtitle("Year", size(small)) ytitle("SO2 emissions (kg/m2/year)", size(small) margin(small))  ///
       xlabel(1990(5)2015, labsize(small))  ylabel(0(2)10, gmin gmax labsize(small))  ///
       legend(pos(6) cols(3) symxsize(6) label(1 "Total") label(2 "Power sector") label(3 "Manufacturing sector") region(lwidth(none))) 

graph export fig1_chns.eps, replace
